package com.bestv.search.common.service;

import com.bestv.search.common.dataSource.DataSourceKey;
import com.bestv.search.common.model.Info;
import com.bestv.search.common.model.Person;
import com.bestv.search.common.model.PersonExtend;
import com.bestv.search.common.model.PersonProduct;

import java.util.Date;
import java.util.List;
import java.util.Map.Entry;
import java.util.Set;

public interface PersonManager {

    void saveOrUpdate(DataSourceKey key, List<Person> list);

    List<String> getAllName(DataSourceKey key, int start, int limit);

    int getCount(DataSourceKey key);

    void saveProductInfoReferenceList(DataSourceKey key, List<Entry<String, Long>> mapping);

    Set<String> getPersonIdByInfoId(DataSourceKey key, long info_id);

    Set<String> getPersonIdByInfos(DataSourceKey key, List<Info> list);

    List<PersonExtend> getPersonByUpdateTime(DataSourceKey key, Date updateTime, int start, int limit);

    int getPersonCountByUpdateTime(DataSourceKey key, Date updateTime);

    PersonExtend getPersonById(DataSourceKey key, String personId);

    List<PersonExtend> getPersonById(DataSourceKey key, Set<String> personIds);

    List<PersonProduct> getPersonProductsByPersonId(DataSourceKey key, String personId);

    void updateAvatar(DataSourceKey key, String personId, byte[] avatar);

    List<PersonExtend> getPersonByName(DataSourceKey key, String name, String[] nationalityArray, int start, int limit);

    int getPersonCountByName(DataSourceKey key, String name, String[] nationalityArray);
}
